package com.crm.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the USERINFO database table.
 * 
 */
@Entity
@NamedQuery(name="Userinfo.findAll", query="SELECT u FROM Userinfo u")
public class Userinfo implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="USERINFO_UID_GENERATOR", sequenceName="SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="USERINFO_UID_GENERATOR")
	@Column(name="U_ID")
	private Long uId;

	private String phone;

	@Temporal(TemporalType.DATE)
	@Column(name="UCREATE_TIME")
	@JSONField(format = "yyyy-MM-dd")
	private Date ucreateTime;

	private String uimage;

	private String uname;

	private String upassword;

	@Column(name="UREAL_NAME")
	private String urealName;

	@Column(name="USER_ADDRESS")
	private String userAddress;

	private String ustatus;

	//bi-directional many-to-one association to CrmDept
	@ManyToOne
	@JoinColumn(name="CRM_DEPTNO")
	private CrmDept crmDept;

	@Transient
	private Long crmDeptno;
	
	//bi-directional many-to-many association to Role
	@ManyToMany
	@JoinTable(
		name="USER_ROLE"
		, joinColumns={
			@JoinColumn(name="U_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="RID")
			}
		)
	@JSONField(serialize=false)
	private List<Role> roles;

	public Userinfo() {
	}

	
	public Long getCrmDeptno() {
		return crmDeptno;
	}


	public void setCrmDeptno(Long crmDeptno) {
		this.crmDeptno = crmDeptno;
	}


	public Long getUId() {
		return this.uId;
	}

	public void setUId(Long uId) {
		this.uId = uId;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Date getUcreateTime() {
		return this.ucreateTime;
	}

	public void setUcreateTime(Date ucreateTime) {
		this.ucreateTime = ucreateTime;
	}

	public String getUimage() {
		return this.uimage;
	}

	public void setUimage(String uimage) {
		this.uimage = uimage;
	}

	public String getUname() {
		return this.uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getUpassword() {
		return this.upassword;
	}

	public void setUpassword(String upassword) {
		this.upassword = upassword;
	}

	public String getUrealName() {
		return this.urealName;
	}

	public void setUrealName(String urealName) {
		this.urealName = urealName;
	}

	public String getUserAddress() {
		return this.userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	public String getUstatus() {
		return this.ustatus;
	}

	public void setUstatus(String ustatus) {
		this.ustatus = ustatus;
	}

	public CrmDept getCrmDept() {
		return this.crmDept;
	}

	public void setCrmDept(CrmDept crmDept) {
		this.crmDept = crmDept;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}